package com.briup.ch06.extend;

public class Father extends Grandpa {
    {
        System.out.println("父类的构造代码块");
    }
    static{
        System.out.println("父类的静态代码块");
    }
    public String address="人民路28号";
    private double price=1000;
    protected String car="BMW";
    String computer="IBM";
    public void fishing(){
        System.out.println("爸爸会钓鱼");
    }
    //在类的内部（自己）：访问任何修饰符
    public void show(){
        System.out.println("父类自己："
                +address+price+car
                +this.computer);
    }
    public void setPrice(double price){
        this.price=price;
    }
    public Father(String address,double price,String car,String computer){
        this.address=address;
        this.price=price;
        this.car=car;
        this.computer=computer;
        System.out.println("父类的有参构造器");
    }
    public Father(){
        System.out.println("父类的无参构造器");
    }
}
